/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package conf;

/**
 *
 * @author dell
 */
import conf.mybatis.mappers.*;
import java.io.IOException;
import java.io.InputStream;
import java.util.Date;
import java.util.List;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import entity.structure.*;
public class Test 
{
public void test1() 
{
     try
     {
         InputStream in=Resources.getResourceAsStream("conf/mybatis/mybatis-conf.xml");
         SqlSessionFactory sf=new SqlSessionFactoryBuilder().build(in);
         SqlSession session=sf.openSession();
         device b=session.getMapper(device.class);
         List<Device> d=b.selectsAll();
//         d.setName("newxgfasgddx");
//         d.setSim("12,.,..fas");
//         int r=b.insert(d);
//         session.commit();
////         bu=b.selectDetail(bu);
         System.out.println(d);
         in.close();
     }
     catch(Exception e)
     {
          e.printStackTrace();
     }
}
public static void main(String[] asd)
{
     Test a=new Test();
     a.test1();
}
}
